from glob import glob
env = Environment()

def build_dir():
    texs = glob("*.tex")
    images=glob("images/*.ps")
    for tex_file in texs:
        if tex_file in ["defs.tex","gdef.tex","global_def.tex"]:
            continue
        first_name=tex_file.split(".")[0]
        dvi = env.DVI(first_name+'.dvi',tex_file)
        Depends(dvi, [tex_file,"defs.tex","gdef.tex"]+images)
        env.Clean(dvi,first_name+".pdf")

env.build_dir=build_dir
SConscript(['Bibla/SConscript',
            'Rudenko/SConscript',
            'Kolodko/SConscript',
            'NoName/SConscript',
            ],exports='env')


